package xyz.eden.boot.core.exception;


import lombok.Getter;
import xyz.eden.boot.core.result.ResultSetEnum;

/**
 * 参数异常
 *
 * @author gavin
 * @version 1.0
 * @descriptor
 * @date 2022/11/22 16:35
 */
@Getter
public class ParameterException extends IllegalArgumentException implements AbstractException {

    private Integer code;
    private String message;
    private ExceptionData exceptionData;

    public ParameterException(String message) {
        this.code = ResultSetEnum.ERROR_PARAM.getCode();
        this.message = message;
    }

    public ParameterException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ParameterException(Integer code, String message, ExceptionData data) {
        super(message);
        this.code = code;
        this.message = message;
        this.exceptionData = data;
    }

    public ParameterException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}
